The present invention relates to software compilers, and more particularly to a method and system for flattening hierarchically structured flows commonly found in flow programming.
Flow programming involves modeling data flows through an arrangement of nodes and connectors. The interconnected arrangement of nodes and the data flows passing through the arrangement are referred to collectively as a “flow”.
In flow programming, applications may be built from a set of building blocks comprising different types of “primitive” nodes and connectors. In the context of the present discussion, primitive nodes are nodes that cannot be “flattened” further (as detailed below). To support a more compact hierarchical structure, “complex” nodes may be introduced. A complex node contains one or more “subflows”, where each “subflow” may comprise one or more nodes. The one or more nodes in each subflow may either be a primitive node or another complex node having its own subflow or subflows. In this manner, a multi-level hierarchical structure of virtually any size may be built.
While it may be convenient to use a hierarchical structure to model a flow, it is not always possible to maintain such a structure. For example, in an application involving a transaction between two disparate systems, one system may not be able to understand a hierarchically structured flow built in another system, and vice versa. In this case, it may be necessary to convert the hierarchically structured flow into an equivalent flat flow which performs in essentially the same way as the hierarchically structured flow. This flat flow may then be deployed into an intermediary system acting as a broker between the disparate systems.
Known techniques for flattening hierarchically structured flows are generally functional, but may be inefficient when used with certain types of hierarchically structured flows. In particular, a more efficient technique is needed for flattening hierarchically structured flows having significant breadth.